package com.jwdf.uda.http.action;

import android.content.Context;

import com.jwdf.uda.bean.PbBean;
import com.jwdf.uda.http.AHttpService;
import com.jwdf.uda.http.ApiService;

import retrofit2.Call;

/**
 * 类说明：
 * 作者：huangqiuxin on 2016/5/14 13:54
 * 邮箱：648859026@qq.com
 */
public class GuideGetInteractionListAction extends AHttpService<PbBean.PbResGuideGetInteractionList> {

    public static GuideGetInteractionListAction newInstance(Context context, int id, int offset, PbBean.PbSignInteractionListSortType sortType) {
        return new GuideGetInteractionListAction(context, id, offset, sortType);
    }

    private int id;
    private int offset;
    private PbBean.PbSignInteractionListSortType sortType;

    private GuideGetInteractionListAction(Context context, int id, int offset, PbBean.PbSignInteractionListSortType sortType) {
        super(context);
        this.id = id;
        this.offset = offset;
        this.sortType = sortType;
    }

    @Override
    protected Call newRetrofitCall(ApiService apiService, PbBean.PbBaseClientInfo.Builder baseBuilder) {
        PbBean.PbReqGuideGetInteractionList.Builder builder = PbBean.PbReqGuideGetInteractionList.newBuilder();
        builder.setBaseClientInfo(baseBuilder);
        builder.setId(id);
        builder.setOffset(offset);
        builder.setSortType(sortType);

        return apiService.guideGetInteractionList(builder.build());
    }
}
